function [meanVal, uncertainty, cleanData, outliers] = analyzeMeasurements_IQR_builtin(data)
% 使用 MATLAB 内置 IQR（四分位）方法剔除异常值

    data = data(:);  % 转为列向量
    outlierMask = isoutlier(data, 'quartiles');

    cleanData = data(~outlierMask);
    outliers = data(outlierMask);

    meanVal = mean(cleanData);
    uncertainty = std(cleanData) / sqrt(length(cleanData));
end

